﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Infrastructure.Error
{
    public class BizException : Exception
    {
        public Dictionary<string, object> data = null;
        public BizException(string msg) : base(msg) { }

        public BizException(string msg, Action<Dictionary<string, object>> action = null) : base(msg)
        {
            if (action != null)
            {
                data = new Dictionary<string, object>();
                action(data);
            }
        }
    }

    public class NotRegisterException : BizException
    {
        public Dictionary<string, object> data = null;
        public NotRegisterException(string msg) : base(msg) { }

        public NotRegisterException(string msg, Action<Dictionary<string, object>> action = null) : base(msg)
        {
            if (action != null)
            {
                data = new Dictionary<string, object>();
                action(data);
            }
        }
    }
}
